Skip to main content

Sync Multi Leg Orders

🧾 Sync Multi Leg Order Request​

FieldDetails
API NameSyncTrades (Provided exactly as in your source — although logically this endpoint should be named SyncMultiLegOrders)
URL Format<protocol>://<domain name:port>/<VirtualDir>/<URL>
Example URLhttps://localhost:8080/OTPA/V1/SyncMultiLegOrders
DescriptionThis request retrieves all multi‑leg orders available in the system. Upon receiving this request, the system sends multi‑leg order information messages. The request must include jToken received in the Authentication API response.

📤 Sync Multi Leg Order Request Parameters​

ParameterData TypeDescription
jMessageTypevarchar(15)Must be sent as SYNC_ORDER_REQ
jManagerIDvarchar(50)Manager Identification Number
jCustomerIdvarchar(50)Customer ID assigned to the user
jExchangeintExchange identifier
jTokenvarchar(512)Authentication token received in Authentication API response
jEntrySequenceNumberint64Last received sequence number; default 0 if not provided
jRequestIDvarchar(255)Echo‑back field

📦 Sync Multi Leg Orders Response​

The response contains the following parameters:

ParameterData TypeDescription
jManagerIdvarchar(50)User ID assigned to the user
jCustomerIdvarchar(50)Customer ID assigned to the user
jLastSyncedPacketintIndicates if this is the last packet: 1 = Last packet
jNoOfRecordsintNumber of multi‑leg order records included
jOrderMessageMulti‑Leg Order Detail Structure (array)Array containing multi‑leg order messages of size jNoOfRecords
jRequestIDvarchar(255)Echo‑back field
jResponseIDvarchar(255)System‑generated alphanumeric ID

📡 Multi‑Leg Order Detail Structure​

Each entry within jOrderMessage includes the following parameters:

Parameter (Key)Data TypeDescription
Cli Order NumberintGateway/Client order number (system‑generated)
Exchangevarchar(10)Exchange
Order Typevarchar(50)Order type
Book Typevarchar(10)Book type (e.g., RL)
Order Statusvarchar(15)Multi‑leg order status
Reasonvarchar(300)Reason code for rejection (if any)
Order Validity—Validity of the multi‑leg order
Pro/CliintParticipant flag:
• 2 → PRO
• 1 → CLI
User IDvarchar(10)Client code (blank for PRO orders)
DealerCodevarchar(5)Unique user identification code
Part Codevarchar(12)Participant code
Order Entry Timevarchar(10)Order entry timestamp (e.g., 15Jun2018 15.25.15)
Last Modified Timevarchar(10)Last modified timestamp (e.g., 15Jun2018 15.25.15)
Aliasvarchar(5)Alias ID; blank if not applicable
InitiatedByvarchar(25)Application from which order was initiated (e.g., ADMIN, NET)
ModifiedByvarchar(25)Application from which order was modified
InitiatedByUserIdvarchar(25)User ID that initiated the order
ModifiedByUserIdvarchar(25)User ID that modified the order
Price DifferencefloatPrice difference of spread tokens
1st Exchange Order NumberintFirst leg exchange order number
1st Leg Scrip TokenintFirst leg scrip token number
1st Leg Symbolvarchar(13)First leg security name
1st Leg InstrumentNamevarchar(6)First leg instrument name
1st Leg Expiry Datevarchar(10)First leg expiry date (ddMMMyyyy, e.g., 24JUN2004). Applicable for F&O only; blank otherwise.
1st Leg Strike PricefloatFirst leg strike price (in rupees). Applicable for options only; otherwise -1.
1st Leg Option_Typevarchar(2)First leg option type
1st Leg Buy_SellintBuy/Sell flag:
• 1 → Buy
• 2 → Sell
1st Leg Order Original QtyintFirst leg original order quantity
1st Leg Pending QtyintFirst leg pending quantity
1st Leg TradedQTYintFirst leg traded quantity
1st Leg Order PricefloatFirst leg order price (in rupees)
1st Leg Product Typevarchar(5)Product type of the first leg
2nd Exchange Order NumberintSecond leg exchange order number
2nd Leg Scrip TokenintSecond leg scrip token number
2nd Leg Symbolvarchar(13)Second leg security name
2nd Leg InstrumentNamevarchar(6)Second leg instrument name
2nd Leg Expiry Datevarchar(10)Second leg expiry date (ddMMMyyyy, e.g., 24JUN2004). Applicable for F&O only; blank otherwise.
2nd Leg Strike PricefloatSecond leg strike price (in rupees). Applicable for options only; otherwise -1.
2nd Leg Option_Typevarchar(2)Second leg option type
2nd Leg Buy_SellintSecond leg Buy/Sell flag:
• 1 → Buy
• 2 → Sell
2nd Leg Order Original QtyintSecond leg original order quantity
2nd Leg Pending QtyintSecond leg pending quantity
2nd Leg TradedQTYintSecond leg traded quantity
2nd Leg Order PricefloatSecond leg order price (in rupees)
2nd Leg Product Typevarchar(5)Product type for the second leg
3rd Exchange Order NumberintThird leg exchange order number
3rd Leg Scrip TokenintThird leg scrip token number
3rd Leg Symbolvarchar(13)Third leg security name
3rd Leg InstrumentNamevarchar(6)Third leg instrument name
3rd Leg Expiry Datevarchar(10)Third leg expiry date (ddMMMyyyy, e.g., 24JUN2004). Applicable for F&O only; blank otherwise.
3rd Leg Strike PricefloatThird leg strike price (in rupees). Applicable for options only; otherwise -1.
3rd Leg Option_Typevarchar(2)Third leg option type
3rd Leg Buy_SellintThird leg Buy/Sell flag:
• 1 → Buy
• 2 → Sell
3rd Leg Order Original QtyintThird leg original order quantity
3rd Leg Pending QtyintThird leg pending quantity
3rd Leg TradedQTYintThird leg traded quantity
3rd Leg Order PricefloatThird leg order price (in rupees)
3rd Leg ProductTypevarchar(5)Product type of the third leg
LocationIDvarchar(5)Location ID (PIN + NSECTCLBRANCH ID + NSECTCLID + ALGO FLAG + VENDOR CODE)
User Remarksvarchar(50)User‑provided remarks
Miscvarchar(50)Miscellaneous details. Possible values:
• SPO-LMT
• SPO-MKT
• PO-MKT
• PO-LMT
Prot%—Valid only for BSE. Applicable when nMarket = 1. Divide value by 100; otherwise 0.
SequenceNoint64Unique sequence number
UniqueCodevarchar(12)Alphanumeric value with special characters